<?php

use App\User;
use Illuminate\Database\Seeder;
use App\Discuss;
use App\Task;

class DiscussTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        $admin = User::find(55);
        $tasks = Task::all();
        foreach ($tasks as $task) {
            Discuss::create([
                'userid' => 5927,
                'tag' => $task->title,
                'title' => $task->title . '的学习资料',
                'userid' => $admin->id,
            ]);
        }

    }
}
